﻿
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace FileConvert
{
    public class MP3Convert : IConvert
    {
        public MP3Convert(string fromFile, string toFile)
        {
            _formFile = fromFile;
            _toFile = toFile;
            _ext = System.IO.Path.GetExtension(fromFile);
        }
        private string _formFile = "";
        private string _toFile = "";
        string _ext = "";
        public string SupportFormat
        {
            get
            {
                return ".wav;.amr;";
            }
        }

        public bool Convert()
        {
            bool result = false;
            string cmd = string.Format(" -i {0} -f mp3 -acodec libmp3lame -y {1}", _formFile, _toFile);

            string command = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "tools", "ffmpeg.exe");
            result = VideoConvert.Convert(command,cmd);
            return result;
        }


    }

 
}

